fix: PMAA-126 ticket#303
Merged
ruturaj-browserstack merged 1 commit intoMay 28, 2026
Merged
Conversation
ruturaj-browserstack
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes PMAA-126: test cases created via the
createTestCaseMCP tool always defaulted to Medium priority, regardless of what the user/agent asked for (e.g. "Critical" or "High").Root cause
createTestCasehad nopriorityfield in its input schema (CreateTestCaseSchema) or itsTestCaseCreateRequestinterface. Since the request body is built directly from those params, priority was never sent to the Test Management API, so the API applied its default (Medium).This is not a TM API contract change — the API still accepts
priorityon create. Verified directly:"critical"(lowercase)Invalid default field value priority"Critical"(display name)The API requires the Title-Case display name.
Changes
create-testcase.ts— addpriorityto the schema + interface, and anormalizePrioritystep that resolves the input to the API-accepted display name (socritical,Critical, orhighall work) before sending. On form-fields lookup failure it passes the raw value through so the backend can surface its own error.TCG-utils/api.ts— extract the existing default-field normalizer into a shared, exportednormalizeDefaultFieldValue(sits next tofetchFormFields/projectIdentifierToId, which it depends on).update-testcase.ts— dedup: replace its private local copy of the normalizer with the shared import. No behavior change.Testing
normalizeDefaultFieldValue(case-insensitive matching, display↔internal name, no-match fallback).createTestCase: normalized priority lands in the request body, priority omitted → not sent (preserves project default), form-fields lookup failure → raw value passed through.tscclean.🤖 Generated with Claude Code